<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui">

<h:head>
	<meta charset="UTF-8"></meta>
	<title>Tìm kiếm nhà trọ theo giá thuê</title>
	<link rel="stylesheet" type="text/css"
		href="resources/css/bootstrap.css" media="all" />
	<link rel="stylesheet" type="text/css"
		href="resources/css/bootstrap-responsive.css" media="all" />
	<link rel="stylesheet" type="text/css" href="resources/css/thu-css.css"
		media="all" />
			<link rel="stylesheet" type="text/css"
		href="resources/css/flexslider.css" media="all" />
	<link rel="stylesheet" type="text/css"
		href="resources/css/font-awesome.css" media="all" />
	<link rel="stylesheet" type="text/css"
		href="resources/css/prettyPhoto.css" media="all" />
	<link rel="stylesheet" type="text/css" href="resources/css/red.css"
		media="all" />
	<link rel="stylesheet" type="text/css"
		href="resources/css/sidebar-nav.css" media="all" />
	<link rel="stylesheet" type="text/css" href="resources/css/style.css"
		media="all" />
	<link rel="stylesheet" type="text/css"
		href="resources/css/icon-css.css" media="all" />
	<link href="resources/css/webwidget_menu_glide.css" rel="stylesheet"
		type="text/css" />
	<link rel="stylesheet" type="text/css"
		href="resources/css/nice-menu.css" media="all" />
	<script type="text/javascript" src="jquery-1.3.2.min.js"></script>
	<style>
body {
	color: teal;
	text-align: center;
}
</style>
</h:head>

<!-- Method kiem tra moi khi trang duoc load -->
<f:event listener="#{nhaTroManageBean.onLoad}" type="preRenderView"></f:event>

<h:body>

	<!-- Include Header -->
	<ui:include src="./header.xhtml"></ui:include>
	<!-- End Header -->

	<div class="container">
		<!-- Left menu & content -->
		<div class="row" style="margin-left: 0px">
			<div class="row-fluid">
				<div class="row-fluid">

					<!-- Include Left Menu -->
					<ui:include src="./leftMenu.xhtml" />
					<!-- End Left Menu -->

					<!-- Content -->
					<div class="span8 pull-left" style="width: 700px; margin-top: 20px">
					<h:form>
						<div id="content-outer">
							<div id="content">

								<p:panel id="panel" header="Tìm kiếm">
									<!-- <p:messages id="msgs" /> -->
									<h:panelGrid columns="3" cellpadding="4">
										<p:outputLabel value="Tìm theo giá thuê:" />
										<p:inputText type="text" value="#{nhaTroManageBean.giaThueTK}">
											<!-- <f:validateLength minimum="2" /> -->
										</p:inputText>
										<!-- <b></b>
						<p:outputLabel value="Tìm kiếm theo địa chỉ:" />
						<p:inputText type="text" value="#{nhaTroManageBean.diaChiTK}">
						</p:inputText> -->

									</h:panelGrid>

									<h:commandButton value="Tìm kiếm" type="submit"
										class="btn btn-primary" style="width: 100px"
										action="#{nhaTroManageBean.timKiemNTTheoGia()}"
										icon="ui-icon-check"></h:commandButton>
								</p:panel>

								<center>
									<b><h2 style="color: teal">Danh sách nhà trọ theo giá</h2></b>
								</center>
								<div
									class="order-table order-table-header order-table-odd-row order-table-even-row">
									<p:dataTable var="list" tableStyle="width:auto"
										value="#{nhaTroManageBean.loadDSNTTheoGia()}" paginator="true"
										rows="10" styleClass="mystyle"
										rowStyleClass="order-table-odd-row,order-table-even-row"
										paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
										rowsPerPageTemplate="5,10,20">
										<p:column headerText="Mã nhà trọ">
											<p style="color: red">#{list.maNT}</p>
										</p:column>
										<p:column headerText="Địa chỉ nhà trọ">#{list.diaChiNT}</p:column>
										<p:column headerText="Giá thuê/1 tháng">#{list.giaThueMotThang}</p:column>
										<p:column headerText="Mô tả nhà trọ">#{list.moTaNT}</p:column>
										<p:column headerText="Trạng thái thuê">#{list.trangThaiThue}</p:column>
										<p:column headerText="Trạng thái duyệt">#{list.trangThaiDuyetNT}</p:column>
										<p:column headerText="Tên chủ NT">#{list.tenTKCNT}</p:column>
										<p:column headerText="Tên Quản trị viên">#{list.tenTKQTV}</p:column>
										<p:column headerText="Hình ảnh">
											<p:graphicImage value="#{list.hinhAnhNT}"
												style="width:50px; height: 80px"></p:graphicImage>
										</p:column>
										<p:column headerText="Tùy chọn">
											<h:commandButton
												actionListener="#{nhaTroManageBean.chitiet()}" type="submit"
												value="Chi tiết" class="btn btn-warning"
												action="chiTietNhaTro" />
										</p:column>
									</p:dataTable>
								</div>
							</div>
						</div>
					</h:form>
					</div>
					<!-- End Content -->
				</div>
			</div>
		</div>
	</div>

	<!-- Include Footer -->
	<ui:include src="./footer.xhtml"></ui:include>
	<!-- End Footer -->
</h:body>
</html>